package com.flot.yazb.model.user;

import com.flot.yazb.base.model.BModel;
import com.flot.yazb.base.client.RetrofitFactory;
import com.flot.yazb.aop.stub.RMCallback;
import com.flot.yazb.aop.stub.RMResponse;
import com.flot.yazb.retrofit.service.BService;


public class SelfModel extends BModel {

    public static void getUserMsg(String id, final Transit<SelfModel> incubator) {
        RetrofitFactory.getInstance()
                .create(BService.UserService.class)
                .getSelfMsg(id)
                .enqueue(new RMCallback<RMResponse<SelfModel>>(incubator.getContext()) {
                    @Override
                    protected void onSuccess(RMResponse<SelfModel> result) {
                        incubator.onBorn(result.content, result.code(), result.message());
                    }

                    @Override
                    protected void onFail(String errorCode, String errorInfo) {
                        incubator.onBorn(null, errorCode, errorInfo);
                    }
                });
    }

    public static void setBaseMsg(FixMsgParmsModel model, final Transit<SelfModel> incubator) {
        RetrofitFactory.getInstance()
                .create(BService.UserService.class)
                .setBaseMsg(model)
                .enqueue(new RMCallback<RMResponse<SelfModel>>(incubator.getContext()) {
                    @Override
                    protected void onSuccess(RMResponse<SelfModel> result) {
                        incubator.onBorn(result.content, result.code(), result.message());
                    }

                    @Override
                    protected void onFail(String errorCode, String errorInfo) {
                        incubator.onBorn(null, errorCode, errorInfo);
                    }
                });
    }




    public String id;
    public String weid;
    public String mid;
    public String height;
    public String weight;
    public String blood;
    public String education;
    public String job;
    public String income;
    public String marriage;
    public String house;
    public String blank;
    public String createtime;
}
